package com.erqi.time;

import com.github.s7connector.api.S7Connector;
import com.github.s7connector.api.factory.S7ConnectorFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @Author king
 * @Date 2020/7/27 08:56
 * @Version 1.0
 */
//@Configuration
public class publicClass {


    public static void main(String[] args) {
        S7Connector connector = S7ConnectorFactory
                .buildTCPConnector()
                .withHost("192.168.35.21") //plc 地址
                .withRack(1) //架机号
                .withSlot(1) //插槽号
                .build();

    }
    Map<String,String> mapK = new LinkedHashMap<>();
    public publicClass() {
        mapK.put("k17","17BT");
        mapK.put("k18","18BT");
        mapK.put("k19","19BT");

        mapK.put("t27","27BT");
        mapK.put("t28","28BT");
        mapK.put("t29","29BT");
        mapK.put("t30","30BT");
        mapK.put("t31","31BT");
    }
    public void tues() {
        mapK.put("k17","17BT");
        mapK.put("k18","18BT");
        mapK.put("k19","19BT");

        mapK.put("t27","27BT");
        mapK.put("t28","28BT");
        mapK.put("t29","29BT");
        mapK.put("t30","30BT");
        mapK.put("t31","31BT");
    }

   // public static Logger log = Logger.getLogger(publicClass.class);

  // @Scheduled(cron = "*/3 * * * * ?")
    public void test(){

        for (String v:mapK.values()) {
            System.out.println("v = " + v);
        }
        mapK.put("t31","6666666666");
        for (String v:mapK.values()) {
            System.out.println("v = " + v);
        }
    }

   // @Scheduled(cron = "*/5 * * * * ?")
    public void test1(){

        tues();
        for (String v:mapK.values()) {
            System.out.println("v 55= " + v);
        }
    }

}
